package sy.model;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by lichenhao on 2017/3/30.
 */
@Entity
@Table(name = "transportDetail")
@DynamicInsert(true)
@DynamicUpdate(true)
public class TtransportDetail implements java.io.Serializable {

	private String id;
	private Tproduct product;
	private int qty;
	private double volume;
	private double weight;

	//所属订单
	private Ttransport transport;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TRANSPORTID")
	public Ttransport getTransport() {
		return transport;
	}

	public void setTransport(Ttransport transport) {
		this.transport = transport;
	}

	@Id
	@Column(name = "ID", nullable = false, length = 36)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PRODUCTID")
	public Tproduct getProduct() {
		return product;
	}

	public void setProduct(Tproduct product) {
		this.product = product;
	}

	@Column(columnDefinition = "INT default 0 comment '数量'")
	public int getQty() {
		return qty;
	}

	public void setQty(int qty) {
		this.qty = qty;
	}

	@Column(columnDefinition = "DOUBLE default 0.0 comment '体积'")
	public double getVolume() {
		return volume;
	}

	public void setVolume(double volume) {
		this.volume = volume;
	}

	@Column(columnDefinition = "DOUBLE default 0.0 comment '重量'")
	public double getWeight() {
		return weight;
	}

	public void setWeight(double weight) {
		this.weight = weight;
	}
}
